struct tm_pool {
bool_t shared;
bool_t persistent;
+ bool_t is_dying;
int pageshift; /* 0 == 2**12 */
struct list_head pool_list; /* FIXME do we need this anymore? */
client_t *client;
int i;
tmem_write_lock(&pool->pool_rwlock);
+ pool->is_dying = 1;
for (i = 0; i < OBJ_HASH_BUCKETS; i++)
{
node = rb_first(&pool->obj_rb_root[i]);
node = rb_next(node);
ASSERT(obj->no_evict == 0);
if ( !selective )
- obj_destroy(obj,1);
+ /* FIXME: should be obj,1 but walking/erasing rbtree is racy */
+ obj_destroy(obj,0);
else if ( obj->last_client == cli_id )
obj_destroy(obj,0);
else
pool->found_gets = pool->gets = 0;
pool->flushs_found = pool->flushs = 0;
pool->flush_objs_found = pool->flush_objs = 0;
+ pool->is_dying = 0;
SET_SENTINEL(pool,POOL);
return pool;
}
{
obj = pgp->obj;
pool = obj->pool;
+ if ( pool->is_dying )
+ continue;
if ( tmh_lock_all && !obj->no_evict )
goto found;
if ( tmem_spin_trylock(&obj->obj_spinlock) )
{
obj = pgp->obj;
pool = obj->pool;
+ if ( pool->is_dying )
+ continue;
if ( tmh_lock_all && !obj->no_evict )
goto found;
if ( tmem_spin_trylock(&obj->obj_spinlock) )